package com.jiayang.hhotel.presenter;

import com.jiayang.hhotel.bean.BuildNoModel;
import com.jiayang.hhotel.bean.BuildingStyle;
import com.jiayang.hhotel.net.Api;
import com.jiayang.hhotel.ui.BuildingStyleActivity;
import com.jiayang.hhotel.ui.BuildingStyleHisActivity;

import cn.droidlover.xdroidmvp.mvp.XPresent;
import cn.droidlover.xdroidmvp.net.ApiSubscriber;
import cn.droidlover.xdroidmvp.net.NetError;
import cn.droidlover.xdroidmvp.net.XApi;

/**
 * Created by Administrator on 2017/5/2 0002.
 */

public class PBuildingStyle extends XPresent<BuildingStyleActivity> {
    protected static final int PAGE_SIZE = 10;


    public void loadData( final int page) {
        Api.getBuildStyleService().getBuildNoList(page,PAGE_SIZE,11,11,"11")
                .compose(XApi.<BuildingStyle>getApiTransformer())
                .compose(XApi.<BuildingStyle>getScheduler())
                .compose(getV().<BuildingStyle>bindToLifecycle())
                .subscribe(new ApiSubscriber<BuildingStyle>() {

                    @Override
                    protected void onFail(NetError error) {

                    }

                    //正常工作
                    @Override
                    public void onNext(BuildingStyle Results) {
                        getV().getdata();
                    }
                });
    }

}
